<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>商家绑定会员</title>
<meta name="content-type" content="text/html; charset=UTF-8">
<jsp:include page="/pub.jsp"></jsp:include>
<script type="text/javascript">
	var aotemaiShop_bindAccount_submitForm = function(dialog, aotemaiShop_datagrid, p) {
		if ($('#aotemaiShop_editForm').form('validate')) {
			$.post('${pageContext.request.contextPath}/aotemaiShop/bindAccount', $("#aotemaiShop_editForm").serialize(), function(j) {
				if (j.success) {
					aotemaiShop_datagrid.datagrid('reload');
					dialog.dialog('destroy');
				}
				p.messager.show({
					title : '提示',
					msg : j.msg,
					timeout : 5000,
					showType : 'slide'
				});
			}, 'json');
		}
	};
	function accountSearch() {
		var dialog = parent.modalDialog({
			id:'account_search_iframe',
			title : '选择会员',
			width : 800,
			height : 500,
			url : '${pageContext.request.contextPath}/aotemaiAccount/searchUI',
			buttons : [ {
				text : '提交',
				handler : function() {
					var accountId = $('#memberId');
					var account = $('#member');
					var accountRealName = $('#accountRealName');
					dialog.find('iframe').get(0).contentWindow.accountSearch_submitForm(dialog, parent.$, accountId,account, accountRealName);
				}
			} ]
		});
	};
	// 初始化搜索框
	$(function(){
		$('#accountRealName').textbox({
			icons: [{
				iconCls:'icon-search',
				handler: function(e){
					accountSearch();
				}
			}]
		});
	});
</script>
</head>

<body>
	<form id="aotemaiShop_editForm" method="post">
		<input type="hidden" name="id" value="${aotemaiShop.id }"/>
		<input type="hidden" id="memberId"/>
		<input type="hidden" name="member" id="member" value="${aotemaiShop.member }"/>
		<table style="width: 100%;" class="table table-hover table-condensed">
			<tr>
				<th>名称</th>
				<td>${aotemaiShop.name }</td>
			</tr>
			<tr>
				<th>编号</th>
				<td>${aotemaiShop.no }</td>
			</tr>
			<tr>
				<th>详细地址</th>
				<td>${aotemaiShop.address }</td>
			</tr>
				<th>邮箱</th>
				<td>${aotemaiShop.email }</td>
			</tr>
			<tr>
				<th>电话</th>
				<td>${aotemaiShop.mobile }</td>
			</tr>
			<tr>
				<th>绑定会员</th>
				<td><input name="accountRealName" id="accountRealName" value="${aotemaiShop.member }"></td>
			</tr>
		</table>
	</form>
</body>
</html>